<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<title>58链车-我要买车</title>
<link rel="stylesheet" href="/Public/App/css/jquery.nstSlider.css">
<link rel="stylesheet" href="/Public/App/css/common.css">
<link rel="stylesheet" href="/Public/App/css/list.css">
<script src="/Public/App/js/jquery-1.12.4.min.js"></script>
<script src="/Public/App/js/jquery.nstSlider.min.js"></script>
<script src="/Public/App/js/common.js"></script>
<script src="/Public/App/js/list.js"></script>
<script>
    function jumpUrl(ctr,key,value)
    {
        if (ctr == '')
            ctr = "getlist";
        url = "/index.php?m=App&c=Car&a=" + ctr + "&pa=0&ma=20";
        url = makeurl(key, value, url);
        var big = "0";
        if ($('#header-switch-btn').hasClass('big'))
        {
            big = "1";
        }
        url += "&big=" + big;
        // console.log(url);return;
        window.location.href = url;
    }
    var pagenum = 0;
    var maxcount = <?php echo ($maxcount); ?>;
    var lockajax = false;
    function jumpAjax() {
        if (pagenum * 20 >= maxcount)
        {
            return "";
        }
        
        url = "/svr/list?pa=" + pagenum + "&ma=20";
        return makeurl("", "", url);
    }
    function makeurl( key, value, url)
    {
        if (key == 'or')
            url += '&' + key + '=' + value;
        else
            url += "&or=<?php echo ($or); ?>";
        if (key == 'ci')
            url += '&' + key + '=' + value;
        else
            url += "&ci=<?php echo (session('ci')); ?>";
        if (key == 'pl')
            url += '&' + key + '=' + value;
        else
            url += "&pl=<?php echo (session('mycity')); ?>";
        if (key == 'ke')
            url += '&' + key + '=' + value;
        else
            url += "&ke=<?php echo ($ke); ?>";
        if (key == 'br')
            url += '&' + key + '=' + value;
        else
            url += "&br=<?php echo ($br); ?>";
        if (key == 'se')
            url += '&' + key + '=' + value;
        else
            url += "&se=<?php echo ($se); ?>";
        if (key == 'pr')
            url += '&' + key + '=' + value;
        else
            url += "&pr=<?php echo ($pr); ?>";
        if (key == 'mo')
            url += '&' + key + '=' + value;
        else
            url += "&mo=<?php echo ($mo); ?>";
        if (key == 'ta')
            url += '&' + key + '=' + value;
        else
            url += "&ta=<?php echo ($ta); ?>";
        if (key == 'ag')
            url += '&' + key + '=' + value;
        else
            url += "&ag=<?php echo ($ag); ?>";
        if (key == 'lo')
            url += '&' + key + '=' + value;
        else
            url += "&lo=<?php echo ($lo); ?>";
        if (key == 'di')
            url += '&' + key + '=' + value;
        else
            url += "&di=<?php echo ($di); ?>";
        if (key == 'en')
            url += '&' + key + '=' + value;
        else
            url += "&en=<?php echo ($en); ?>";
        if (key == 'oi')
            url += '&' + key + '=' + value;
        else
            url += "&oi=<?php echo ($oi); ?>";
        if (key == 'con')
            url += '&' + key + '=' + value;
        else
            url += "&con=<?php echo ($con); ?>";
       return url;
    }
    </script>
</head>
<body>
<!-- header start -->
<header class="header clearfix">
    <a class="header-logo" href="/index.php?m=App&c=Index&a=index"></a>
    <div class="header-search-wrap clearfix">
        <a class="header-search-city" href="/index.php?m=App&c=Index&a=listcity"><?php echo (session('mycity')); ?>&nbsp;</a>
        <button id="header-search-btn" class="header-search-btn">搜索您想要的车</button>
    </div>
    <button id="header-switch-btn" class="header-switch-btn <?php if($big == '1' ): ?>big<?php endif; ?>"></button>
</header>
<!-- header end -->

<!-- buycar btn start -->
<a id="buycar-btn" style="display:none" href="/index.php?m=App&c=Index&a=getlist&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&pa=0&ma=20&or=d">我要买车</a>
<!-- buycar btn end -->

<!-- nav start -->
<nav class="nav">
    <a class="nav-btn" href="javascript:void(0)" data-id="sort">智能排序</a>
    <a href="javascript:jumpUrl('listbrand','','')">品牌</a>
    <a class="nav-btn" href="javascript:void(0)" data-id="price">价格</a>
    <a href="javascript:jumpUrl('listfilter','','')">筛选</a>
</nav>
<!-- nav end -->

<!-- filter start -->
    <?php if($showreset == '1'): ?><div class="filter clearfix">
            <ul>
                <?php if(!empty($showke)): ?><li><a name="ke" class="filterkey" href="#"><?php echo ($showke); ?></a></li><?php endif; ?>
                <?php if(!empty($br)): ?><li><a name="br" class="filterkey" href="#"><?php echo ($br); ?></a></li><?php endif; ?>
                <?php if(!empty($se)): ?><li><a name="se" class="filterkey" href="#"><?php echo ($se); ?></a></li><?php endif; ?>
                <?php if(!empty($showpr)): ?><li><a name="pr" class="filterkey" href="#"><?php echo ($showpr); ?></a></li><?php endif; ?>
                <?php if(!empty($mo)): ?><li><a name="mo" class="filterkey" href="#"><?php echo ($mo); ?></a></li><?php endif; ?>
                <?php if(!empty($ta)): $_result=explode(',',$ta);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$keytag): $mod = ($i % 2 );++$i;?><li><a name="ta" fullvalue="<?php echo ($ta); ?>" class="filterkey" href="#"><?php echo ($keytag); ?></a></li><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                <?php if(!empty($en)): ?><li><a name="en" class="filterkey" href="#"><?php echo ($en); ?></a></li><?php endif; ?>
                <?php if(!empty($showage)): ?><li><a name="ag" class="filterkey" href="#"><?php echo ($showage); ?></a></li><?php endif; ?>
                <?php if(!empty($showlong)): ?><li><a name="lo" class="filterkey" href="#"><?php echo ($showlong); ?></a></li><?php endif; ?>
                <?php if(!empty($oi)): $_result=explode(',',$oi);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$keyoi): $mod = ($i % 2 );++$i;?><li><a name="oi" fullvalue="<?php echo ($oi); ?>" class="filterkey" href="#"><?php echo ($keyoi); ?></a></li><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                <?php if(!empty($con)): $_result=explode(',',$con);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$keycon): $mod = ($i % 2 );++$i;?><li><a name="con" fullvalue="<?php echo ($con); ?>" class="filterkey" href="#"><?php echo ($keycon); ?></a></li><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                <?php if(!empty($wat)): $_result=explode(',',$wat);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$keywat): $mod = ($i % 2 );++$i;?><li><a name="wat" class="filterkey" href="#">急售</a></li><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                <?php if(!empty($sea)): $_result=explode(',',$sea);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$keysea): $mod = ($i % 2 );++$i;?><li><a name="sea" class="filterkey" href="#">7座以上</a></li><?php endforeach; endif; else: echo "" ;endif; endif; ?>


            </ul>
            <a href="/index.php?m=App&c=Index&a=getlist&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&pa=0&ma=20&or=d">重置</a>
        </div><?php endif; ?>
<!-- filter end -->

<!-- list start -->
<ul id="list" class="list <?php if($big == '1' ): ?>big<?php endif; ?>">
<?php if(is_array($datalist)): $k = 0; $__LIST__ = $datalist;if( count($__LIST__)==0 ) : echo "$emptylist" ;else: foreach($__LIST__ as $key=>$car): $mod = ($k % 2 );++$k;?><li>
        <a class="clearfix" href="<?php echo U('App/Car/detail',array('id'=>$car[id]));?>">
            
            <?php $_result=explode(',',$car['imgs']);if(is_array($_result)): $i = 0; $__LIST__ = array_slice($_result,0,1,true);if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vx): $mod = ($i % 2 );++$i;?><img src="__IMAGES__/<?php echo ($vx); ?>.png"><?php endforeach; endif; else: echo "$emptylist" ;endif; ?>
            <p class="list-title"><?php echo ($car["na"]); ?></p>
            <p class="list-info"><?php echo ($car["ds"]); ?></p>
            <p class="list-price"><?php echo ($car["cp"]); ?>万<s>新车<?php echo ($car["newprice"]); ?>万</s></p>
        </a>
    </li><?php endforeach; endif; else: echo "" ;endif; ?>
</ul>
<!-- list end -->

<p class="loading" style="display:none"><a href='tel:400-100-1313'>更多最新车源信息联系400-100-1313</a></p>

<!-- search start -->
<div id="search" class="search-wrap">
    <div class="search-header clearfix">
        <button id="search-close" class="search-close"></button>
        <div class="search-input">
            <input id="search-input" type="text">
        </div>
        <button id="search-do" class="search-btn"></button>
    </div>
    <div id="history" class="history-wrap">
        <ul class="history">
            <?php if(is_array($keysearchlog)): $i = 0; $__LIST__ = $keysearchlog;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$key): $mod = ($i % 2 );++$i;?><li><a href="/index.php?m=App&c=Index&a=getlist&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&pa=0&ma=20&or=d&ke=<?php echo ($key["name"]); ?>"><?php echo ($key["name"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <?php if(empty($keysearchlog)): else: ?><a id="history-clear" class="history-clear" href="javascript:void(0)">清除历史记录</a><?php endif; ?>

    </div>
    <p class="search-title">热销车系：</p>
    <ul class="search-hot clearfix">
        <li>
            <a href="/index.php?m=App&c=Car&a=getlist&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&pa=0&ma=20&or=d&se=朗逸">朗逸</a>
        </li>
        <li>
            <a href="/index.php?m=App&c=Car&a=getlist&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&pa=0&ma=20&or=d&se=高尔夫">高尔夫</a>
        </li>
        <li>
            <a href="/index.php?m=App&c=Car&a=getlist&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&pa=0&ma=20&or=d&se=速腾">速腾</a>
        </li>
        <li>
            <a href="/index.php?m=App&c=Car&a=getlist&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&pa=0&ma=20&or=d&se=福克斯">福克斯</a>
        </li>
        <li>
            <a href="/index.php?m=App&c=Car&a=getlist&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&pa=0&ma=20&or=d&se=大众POLO">大众POLO</a>
        </li>
        <li>
            <a href="/index.php?m=App&c=Car&a=getlist&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&pa=0&ma=20&or=d&se=科鲁兹">科鲁兹</a>
        </li>
    </ul>
</div>
<!-- search end -->

<button id="totop" class="totop"></button>

<!-- sort start -->
<div id="sort" class="list-popup">
    <ul class="sort">
        <li><a class="sort-item1 <?php if($or == 'd' ): ?>active<?php endif; ?>" href="/index.php?m=App&c=Index&a=getlist&pa=0&ma=20&or=d&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&ke=<?php echo ($ke); ?>&br=<?php echo ($br); ?>&se=<?php echo ($se); ?>&pr=<?php echo ($pr); ?>&mo=<?php echo ($mo); ?>&ta=<?php echo ($ta); ?>&ag=<?php echo ($ag); ?>&lo=<?php echo ($lo); ?>&di=<?php echo ($di); ?>&en=<?php echo ($en); ?>&oi=<?php echo ($oi); ?>&con=<?php echo ($con); ?>">智能排序</a></li>
        <li><a class="sort-item2 <?php if($or == 'n' ): ?>active<?php endif; ?>" href="/index.php?m=App&c=Index&a=getlist&pa=0&ma=20&or=n&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&ke=<?php echo ($ke); ?>&br=<?php echo ($br); ?>&se=<?php echo ($se); ?>&pr=<?php echo ($pr); ?>&mo=<?php echo ($mo); ?>&ta=<?php echo ($ta); ?>&ag=<?php echo ($ag); ?>&lo=<?php echo ($lo); ?>&di=<?php echo ($di); ?>&en=<?php echo ($en); ?>&oi=<?php echo ($oi); ?>&con=<?php echo ($con); ?>">最新上架</a></li>
        <li><a class="sort-item3 <?php if($or == 'pa' ): ?>active<?php endif; ?>" href="/index.php?m=App&c=Index&a=getlist&pa=0&ma=20&or=pa&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&ke=<?php echo ($ke); ?>&br=<?php echo ($br); ?>&se=<?php echo ($se); ?>&pr=<?php echo ($pr); ?>&mo=<?php echo ($mo); ?>&ta=<?php echo ($ta); ?>&ag=<?php echo ($ag); ?>&lo=<?php echo ($lo); ?>&di=<?php echo ($di); ?>&en=<?php echo ($en); ?>&oi=<?php echo ($oi); ?>&con=<?php echo ($con); ?>">价格最低</a></li>
        <li><a class="sort-item4 <?php if($or == 'pd' ): ?>active<?php endif; ?>" href="/index.php?m=App&c=Index&a=getlist&pa=0&ma=20&or=pd&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&ke=<?php echo ($ke); ?>&br=<?php echo ($br); ?>&se=<?php echo ($se); ?>&pr=<?php echo ($pr); ?>&mo=<?php echo ($mo); ?>&ta=<?php echo ($ta); ?>&ag=<?php echo ($ag); ?>&lo=<?php echo ($lo); ?>&di=<?php echo ($di); ?>&en=<?php echo ($en); ?>&oi=<?php echo ($oi); ?>&con=<?php echo ($con); ?>">价格最高</a></li>
        <li><a class="sort-item5 <?php if($or == 'a' ): ?>active<?php endif; ?>" href="/index.php?m=App&c=Index&a=getlist&pa=0&ma=20&or=a&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&ke=<?php echo ($ke); ?>&br=<?php echo ($br); ?>&se=<?php echo ($se); ?>&pr=<?php echo ($pr); ?>&mo=<?php echo ($mo); ?>&ta=<?php echo ($ta); ?>&ag=<?php echo ($ag); ?>&lo=<?php echo ($lo); ?>&di=<?php echo ($di); ?>&en=<?php echo ($en); ?>&oi=<?php echo ($oi); ?>&con=<?php echo ($con); ?>">车龄最短</a></li>
        <li><a class="sort-item6 <?php if($or == 'l' ): ?>active<?php endif; ?>" href="/index.php?m=App&c=Index&a=getlist&pa=0&ma=20&or=l&ci=<?php echo (session('ci')); ?>&pl=<?php echo (session('mycity')); ?>&ke=<?php echo ($ke); ?>&br=<?php echo ($br); ?>&se=<?php echo ($se); ?>&pr=<?php echo ($pr); ?>&mo=<?php echo ($mo); ?>&ta=<?php echo ($ta); ?>&ag=<?php echo ($ag); ?>&lo=<?php echo ($lo); ?>&di=<?php echo ($di); ?>&en=<?php echo ($en); ?>&oi=<?php echo ($oi); ?>&con=<?php echo ($con); ?>">里程最少</a></li>
    </ul>
</div>
<!-- sort end -->
<!-- price start -->
<div id="price" class="list-popup">
    <ul class="price clearfix">
        <li><a href="javascript:jumpUrl('','pr','');">不限</a></li>
        <li><a href="javascript:jumpUrl('','pr','<3');">3万以下</a></li>
        <li><a href="javascript:jumpUrl('','pr','3-5');">3-5万</a></li>
        <li><a href="javascript:jumpUrl('','pr','5-7');">5-7万</a></li>
        <li><a href="javascript:jumpUrl('','pr','7-9');">7-9万</a></li>
        <li><a href="javascript:jumpUrl('','pr','9-12');">9-12万</a></li>
        <li><a href="javascript:jumpUrl('','pr','12-16');">12-16万</a></li>
        <li><a href="javascript:jumpUrl('','pr','16-20');">16-20万</a></li>
        <li><a href="javascript:jumpUrl('','pr','>20');">20万以上</a></li>
    </ul>
    <div class="price-range-title clearfix">
        <p>自定义价格</p>
        <span>（单位: 万）</span>
        <a href="javascript:jumpUrl('','pr', $('#price-cur').attr('curvalue'));">确定</a>
    </div>
    <div class="nstSliderWrap">
        <div id="price-slider" class="nstSlider" data-range_min="0" data-range_max="50" data-cur_min="0" data-cur_max="50">
             <div id="price-bar" class="bar">
                <p id="price-cur" curvalue="" class="nstSliderLabel"></p>
             </div>
             <div id="price-leftGrip" class="leftGrip"></div>
             <div id="price-rightGrip" class="rightGrip"></div>
        </div>
        <span class="nstSliderZero">0</span>
        <ul class="nstSliderAxis">
            <li></li>
            <li>10</li>
            <li></li>
            <li>20</li>
            <li></li>
            <li>30</li>
            <li></li>
            <li>40</li>
            <li></li>
            <li>不限</li>
        </ul>
    </div>
</div>
<!-- price end -->
</body>

</html>